﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kokomo.Mirror.CliMetadata;
using System.Reflection;

namespace Kokomo.PeInspector.Reflection
{
	class ReflectionLoadContext : IAssemblyLoadContext
	{
		public ReflectionLoadContext()
		{
			this._searchPaths = new List<string>();
		}

		private List<string> _searchPaths;

		public System.Reflection.Assembly LoadAssembly(System.Reflection.AssemblyName assemblyName)
		{
			return Assembly.Load(assemblyName);
		}

		public System.Reflection.Assembly LoadAssembly(System.Reflection.AssemblyName assemblyName, System.Reflection.Assembly referencingAssembly)
		{
			return Assembly.Load(assemblyName);
		}

		public System.Reflection.Assembly LoadAssemblyFile(string assemblyPath)
		{
			return Assembly.LoadFrom(assemblyPath);
		}

		public System.Reflection.Assembly LoadAssembly(System.Reflection.AssemblyName assemblyName, string searchDirectory)
		{
			return Assembly.Load(assemblyName);
		}

		public Assembly[] GetLoadedAssemblies()
		{
			return AppDomain.CurrentDomain.GetAssemblies();
		}
	}
}
